import socket
import threading
class client():
    def __init__(self):
        c = socket.socket()
        c.connect(('127.0.0.1',9999))
        print(c.recv(1024).decode())
        # self.re_se_msg(c)
        t1=threading.Thread(target=self.se_msg,args=(c,)).start()
        t2=threading.Thread(target=self.re_msg,args=(c,)).start()
    def se_msg(self,con):
        while 1:
            data = input('')
            con.send(('------------\n'+'客户端1发送:\n'+data+'\n--------------').encode())
            d = False
    def re_msg(self,con):
        while 2:
            print(con.recv(1024).decode())

client()

